#ifndef	_BRAINGUI_H_
#define	_BRAINGUI_H_

#include <qframe.h>
#include <qtextedit.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qwidget.h>
#include <qtabwidget.h>
#include "MemBlock.h"
#include <qboxlayout.h>

#define	MAXPROCS	12

extern "C"
{
	void* startbrain(void* strFilePath);
}

typedef struct _LEGENDENTRY{
	QLabel*	procLbl;
	QWidget* colorBlock;
} LEGENDENTRY;

class BrainGUI : public QWidget
{
	Q_OBJECT

public:
	BrainGUI(QWidget* parent = 0);
	void AddLine(char* string);
	int CanContinue(void);

protected:
	void paintEvent(QPaintEvent* event);

private:
	void SetupLegend(void);

private slots:	
	void GetBrainFilePath(void);
	void StartContinue(void);

private:
	bool m_bRunning;
	int m_nCanContinue;
	QGridLayout* m_mainLayout;
	QString m_brainPath;
	QTextEdit* m_brainFileView;
	QLabel* m_pathLabel;
	QLineEdit* m_brainpathEdit;
	QPushButton* m_browseBtn;
	QPushButton* m_startcontBtn; 
	MemBlock* m_mainMemBlock;
	MemBlock* m_sharedMemBlock;
	QFrame*	m_memFrame;
	QTabWidget* m_processTabs;
	LEGENDENTRY m_legend[MAXPROCS];
};
#endif
